package com.xiaoyang.forum.common.code;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: XiaoYang
 * @CreateTime: 2025-08-10
 * @Description: 响应结果状态码
 */
@Getter
@AllArgsConstructor
public enum ResultCode {
    /**
     * 状态码
     */
    SUCCESS                     (0, "操作成功"),

    FAILED                      (1000, "操作失败"),
    FAILED_UNAUTHORIZED         (1001, "未授权"),
    FAILED_PARAMS_VALIDATE      (1002, "参数校验失败"),
    FAILED_FORBIDDEN            (1003, "禁⽌访问"),
    FAILED_CREATE               (1004, "新增失败"),
    FAILED_NOT_EXISTS           (1005, "资源不存在"),

    AILED_USER_EXISTS           (1101, "用户已存在"),
    FAILED_USER_NOT_EXISTS      (1102, "用户不存在"),
    FAILED_LOGIN                (1103, "用户名或密码错误"),
    FAILED_USER_BANNED          (1104, "您已被禁言, 请联系管理员, 并重新登录."),
    FAILED_TWO_PWD_NOT_SAME     (1105, "两次输⼊的密码不⼀致"),
    USER_NO_LOGIN               (1106, "您未登录, 请先登录."),
    FAILED_USER_NO_PERMISSION   (1107, "您没有权限访问该资源."),
    FAILED_REPLY_NOT_EXIST      (1108, "评论不存在"),
    FAILED_EMAIL                (1109, "邮箱格式错误"),
    FAILED_PHONE                (1110, "手机号格式错误"),
    FAILED_PASSWORD_ERROR       (1111, "旧密码错误"),
    NEW_PASSWORD_SAME_AS_OLD    (1112, "新密码不能与旧密码相同"),
    FAILED_MESSAGE_NOT_EXISTS   (1103, "消息不存在"),
    FAILED_FREQUENT             (1104, "操作频繁，请稍后再试"),
    FAILED_TIME_LIMIT           (1105, "操作时间超限"),
    FAILED_INVALID_CODE         (1106, "验证码错误"),
    FAILED_ERROR_CODE           (1107, "验证码已失效"),
    TOKEN_ERROR_CODE            (1108, "token校验失败"),
    FAILED_CANNOT_FOLLOW_SELF   (1109, "不能关注自己"),
    FAILED_FILE_UPLOAD          (1110, "文件上传失败"),
    FAILED_FILE_UPLOAD_TIME_LIMIT(1111, "文件上传时间超限"),
    FAILED_ARTICLE_NOT_EXISTS   (1112, "文章不存在"),

    ERROR_SERVICES              (2000, "服务器内部错误"),
    ERROR_IS_NULL               (2001, "IS NULL."),
    ;

    int code; // 状态码

    String message; // 状态码信息
}
